<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Easy
  </div>
  <div>
   <h1 class="question_title">
    374. Guess Number Higher or Lower
   </h1>
   <p>
    We are playing the Guess Game. The game is as follows:
   </p>
   <p>
    I pick a number from
    <b>
     1
    </b>
    to
    <b>
     <i>
      n
     </i>
    </b>
    . You have to guess which number I picked.
   </p>
   <p>
    Every time you guess wrong, I'll tell you whether the number is higher or lower.
   </p>
   <p>
    You call a pre-defined API
    <code>
     guess(int num)
    </code>
    which returns 3 possible results (
    <code>
     -1
    </code>
    ,
    <code>
     1
    </code>
    , or
    <code>
     0
    </code>
    ):
   </p>
   <pre>
-1 : My number is lower
 1 : My number is higher
 0 : Congrats! You got it!
</pre>
   <p>
    <strong>
     Example :
    </strong>
   </p>
   <div>
    <pre>
<strong>Input: </strong>n = <span id="example-input-1-1">10</span>, pick = <span id="example-input-1-2">6</span>
<strong>Output: </strong><span id="example-output-1">6</span>
</pre>
   </div>
  </div>
  <div>
   <h1 class="question_title">
    374. 猜数字大小
   </h1>
   <p>
    我们正在玩一个猜数字游戏。 游戏规则如下：
    <br>
    我从&nbsp;
    <strong>
     1
    </strong>
    &nbsp;到&nbsp;
    <em>
     <strong>
      n
     </strong>
    </em>
    &nbsp;选择一个数字。 你需要猜我选择了哪个数字。
    <br>
    每次你猜错了，我会告诉你这个数字是大了还是小了。
    <br>
    你调用一个预先定义好的接口&nbsp;
    <code>
     guess(int num)
    </code>
    ，它会返回 3 个可能的结果（
    <code>
     -1
    </code>
    ，
    <code>
     1
    </code>
    &nbsp;或
    <code>
     0
    </code>
    ）：
   </p>
   <pre>-1 : 我的数字比较小
 1 : 我的数字比较大
 0 : 恭喜！你猜对了！
</pre>
   <p>
    <strong>
     示例 :
    </strong>
   </p>
   <pre><strong>输入: </strong>n = 10, pick = 6
<strong>输出: </strong>6</pre>
  </div>
 </body>
</html>